package model.tiles;

import java.awt.Graphics;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import model.Smurf;
import model.World;

/**
 * Tile contains all the information every tile needs to have.
 * 
 * @author juice
 */
public abstract class AbstractTile {
	
	private double friction;
	private ImageIcon icon;
	private String filePath = "";
	
	public void setIcon(String s) {
		this.icon = new ImageIcon(s);
		filePath = s;
	}
	
	public abstract void action(Smurf smurf);
	
	public abstract boolean canJump();

	public Icon getIcon() {
		return icon;
	}

	public void setFriction(double friction) {
		this.friction = friction;
	}

	public double getFriction() {
		return friction;
	}

	public void draw(Graphics g, int x, int y) {
		g.drawImage(icon.getImage(), x, y, World.getInstance().TILES_WIDTH, World.getInstance().TILES_HEIGHT, null);
	}
	
	@Override
	public String toString() {
		return filePath;
	}
}
